package cm.server.controller;

import cm.server.dao.PeopleResidenceRepository;
import cm.server.entity.PeopleResidence;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zy
 * @description
 * @date 2021/4/14 15:03
 */
@RestController
@RequestMapping("areaTrack")
@CrossOrigin
public class PeopleResidenceController {
    @Autowired
    private PeopleResidenceRepository peopleResidenceRepository;

    @RequestMapping(value = "track", method = RequestMethod.GET)
    /**
     *@describtion 用户的区域轨迹
     *@author zy
     *@params [user_id, day]
     *@return java.util.List<cm.server.entity.PeopleResidence>
     *@createTime 2021/4/14 15:07
     */
    public List<PeopleResidence> areaTrack(int user_id, int day) {
        return peopleResidenceRepository.findTrackByUserId(user_id, day);
    }
}
